<div class="header">
    <div class="header-content">
        <div class="logo">
            <img src="__PUBLIC__/Home/static/images/logo.png">
        </div>
        <div class="nav">
            <ul>
                <a href="{:U('Visitor/index')}">
                    <li>
                        <i class="li-img home"></i>
                        <div class="span">主页</div>
                    </li>
                </a>
                <a href="{:U('Search/explore')}">
                    <li>
                        <i class="li-img find"></i>
                        <div class="span">探索</div>
                    </li>
                </a>
                <a href="{:U('Match/index')}">
                    <li>
                        <i class="li-img match"></i>
                        <div class="span">赛事</div>
                    </li>
                </a>
            </ul>
        </div>
        <div class="search">
            <input type="text" placeholder="试试搜点儿什么"/>
            <i class="search-img"></i>
        </div>
        <notempty name="userInfo">
            <div class="down">
                <div class="down-img">
                    <img src="__PUBLIC__/Home/static/images/down.png" alt=""/>
                </div>
                <div class="info-hide">
                    <ul>
                        <li><a href="javascript:;" onclick="warning()">与我相关</a></li>
                        <li><a href="javascript:;" onclick="warning()">我的收藏</a></li>
                        <li class="JS_logout"><a href="javascript:;">退出登录</a></li>
                    </ul>
                </div>
            </div>
            <div class="person-center">
                <a href="{:U('Visitor/index')}">
                    <i class="person-img"></i>
                    <div class="span">{$userInfo.nickname}</div>
                </a>
            </div>
        <else />
            <div class="person-center">
                <a href="{:U('User/register')}">
                    <i class="person-img"></i>
                    <div class="span">账号注册</div>
                </a>
            </div>
            <div class="download">
                <a href="{:U('User/login')}">
                    <i class="login-img"></i>
                    <div class="span">登录</div>
                </a>
            </div>
        </notempty>
        <div class="download">
            <a href="{:U('Download/index')}">
                <i class="download-img"></i>
                <div class="span">下载</div>
            </a>
        </div>
    </div>
    <div class="top-shadow"></div>
</div>
<script src="__PUBLIC__/Home/static/js/public.js"></script>
<script type="text/javascript">
    $('.JS_logout').click(function(){
        $.post('{:U('User/logout')}',{}, function(){
            location.reload();
        });
    });
    $(function(){
        var currentTab = "{$currentTab}";
        if (currentTab == '') {
            return;
        }
        $(".li-img."+currentTab).parents('li').addClass('active');
    });
    function warning() {
        alert('功能暂未开通');
    }
    $('.search>.search-img').click(function(){
        var str = $(this).prev().val();
        if (str.length > 0) {
            location.href = "{:U('Home/search/video')}?title="+str;
        }
    });
    $(".search input").keydown(function (e){
        if(e.which == "13"){
            $('.search>.search-img').click();
        }
    })
</script>